<template>
  <div class="right">
    <div class="g-wrap">
      <!--      入驻歌手-->
      <div class="u-title">
        <h3>
          <span class="f-ff2">入驻歌手</span>
        </h3>
        <a href="#" class="more">更多></a>
      </div>
      <div class="m-sgerlist">
        <ul class="m-cvrlst" v-if="settleSinger">

<!--判断路径-->
          <li v-for="(singer,index) in settleSinger" :key="index" v-if="path==='/ArtistList/ArtistView'">
            <div class="u-cover">
              <img v-lazy="singer.img1v1Url" alt="">
              <router-link :to="{name:'Work',params:{id:singer.id}}" class="main-de"></router-link>
            </div>
            <p>
              <router-link :to="{name:'Work',params:{id:singer.id}}" class="music">{{singer.name}}</router-link>
              <router-link :to="{name:'UserDetail',params:{id:singer.accountId}}" class="detail" v-if="singer.accountId">
                <i class="icon-de"></i>
              </router-link>
            </p>
          </li>

          <!--判断路径-->
          <li v-for="(singer,index) in settleSinger.slice(10,20)" :key="index" v-if="path==='/ArtistView/Signed'">
            <div class="u-cover">
              <img v-lazy="singer.img1v1Url" alt="">
              <router-link :to="{name:'Work',params:{id:singer.id}}" class="main-de"></router-link>
            </div>
            <p>
              <router-link :to="{name:'Work',params:{id:singer.id}}" class="music">{{singer.name}}</router-link>
              <router-link :to="{name:'UserDetail',params:{id:singer.accountId}}" class="detail" v-if="singer.accountId">
                <i class="icon-de"></i>
              </router-link>
            </p>
          </li>

        </ul>
      </div>
      <router-view :hotSinger1="hotSinger1" :hotSinger2="hotSinger2"></router-view>
    </div>

  </div>
</template>

<script>
export default {
  name: "index",
  data(){
    return {
      settleSinger:[],
      hotSinger1:[],
      hotSinger2:[]

    }
  },
  computed:{
    path(){
      return this.$route.path
    }
  },
  methods:{
    async getSinger(){
      let result = await this.$API.reqTopSingers()
      this.settleSinger = result.data.artists
      this.hotSinger1 = result.data.artists.slice(0,10)
      this.hotSinger2 = result.data.artists.slice(10)
    }
  },
  mounted() {
    this.getSinger()
  }

}
</script>

<style scoped lang="less">
.right {
  border-left: 1px solid #D3D3D3;

  .g-wrap {
    padding: 40px;

    .u-title {
      height: 40px;
      border-bottom: 2px solid #c20c0c;

      h3 {
        float: left;
        font-size: 24px;
        font-weight: normal;

        .f-ff2 {
          font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
        }
      }

      .more {
        float: right;
        margin-top: 14px;
        color: #666;
      }
    }
.n-ltlst{
  margin-top: 20px;
  margin-left: -3px;
  height: auto;
  overflow: hidden;

  li{
    display: inline;
    float: left;
    margin-left: 3px;
    font-size: 14px;
    text-align: center;
    line-height: 24px;
    &:last-child{
      a{
        width: 45px;
        font-size: 12px;
      }
    }
    a{
      float: left;
      width: 21px;
      line-height: 24px;
      text-align: center;
      color: #333;
    }
  }
  .f-fs0{
    font-size: 12px;
  }
  .cit{
    background: #c20c0c;
    border-radius: 2px;
    color: #fff;
  }
  .ch{
    display: block;
    width: 45px;
    height: 24px;
  }
}
    .m-sgerlist {
      width: 736px;
      height: auto;
      margin: 20px auto auto auto;
      overflow: hidden;

      .m-cvrlst {
        width: 758px;
        height: auto;
        overflow: hidden;

        li {
          width: 130px;
          margin-right: 21px;
          margin-bottom: 30px;
          height: 154px;
          float: left;
          display: inline-block;
          overflow: hidden;
          line-height: 1.4;

          .u-cover {
            width: 130px;
            height: 130px;
            position: relative;
            display: block;

            img {
              width: 100%;
              height: 100%;
              display: inline-block;
            }

            .main-de {
              position: absolute;
              top: 0;
              left: 0;
              width: 100%;
              height: 100%;
              background-image: url("../../../assets/coverall.png");
              background-position: 0 -680px;
            }
          }

          p {
            margin-top: 8px;
            width: 100%;

            .music {
              float: left;
              max-width: 80%;
              color: #000;
            }

            .detail {
              float: right;

              .icon-de {
                width: 17px;
                height: 18px;
                background-position: 0 -740px;
                margin-top: -1px;
                display: inline-block;
                overflow: hidden;
                vertical-align: middle;
                background-image: url("../../../assets/icon.png");
              }
            }
          }
        }
      }
    }

    .m-cvrlst-5 {
      width: 736px;
      height: auto;
      margin-top: 10px;
      overflow: hidden;

      .sml {
        height: 30px;
        width: 130px;
        float: left;
        margin-left: 17px;
        padding-bottom: 0;
        line-height: 23px;

        .music1 {
          float: left;
          color: #000;
        }

        .detail1 {
          float: left;
          width: 17px;
          height: 18px;
          display: inline-block;
          margin-left: 2px;
          .icon-de {
            width: 17px;
            height: 18px;
            background-position: 0 -740px;
            margin-top: -1px;
            display: inline-block;
            overflow: hidden;
            vertical-align: middle;
            background-image: url("../../../assets/icon.png");
          }
        }
      }
    }
  }

}
</style>